
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>2.2019-12-28-从零到一环境安装 · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="从零到一环境安装">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="2019-12-30-vi-常用命令.html" />
    
    
    <link rel="prev" href="2019-12-28-Linux常用命令和快捷键.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    简介
            
                </a>
            

            
        </li>
    

    
        
        <li class="divider"></li>
        
        
    
        <li class="chapter " data-level="2.1" >
            
                <span>
            
                    
                    [bigdata]
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1.1" data-path="../bigdata/2019-12-30-spark-in-docker.html">
            
                <a href="../bigdata/2019-12-30-spark-in-docker.html">
            
                    
                    1.2019-12-30-spark-in-docker
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.2" data-path="../bigdata/2019-12-30-spark-RDD.html">
            
                <a href="../bigdata/2019-12-30-spark-RDD.html">
            
                    
                    2.2019-12-30-spark-RDD
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.1.3" data-path="../bigdata/2019-12-31-hadoop-hdfs命令别名.html">
            
                <a href="../bigdata/2019-12-31-hadoop-hdfs命令别名.html">
            
                    
                    3.2019-12-31-hadoop-hdfs命令别名
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.2" >
            
                <span>
            
                    
                    [c]
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.2.1" data-path="../c/2020-01-07-c语言.html">
            
                <a href="../c/2020-01-07-c语言.html">
            
                    
                    1.2020-01-07-c语言
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.2" data-path="../c/2020-01-07-C语言基础教程.html">
            
                <a href="../c/2020-01-07-C语言基础教程.html">
            
                    
                    2.2020-01-07-C语言基础教程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.2.3" data-path="../c/2020-01-09-c语言语法基础.html">
            
                <a href="../c/2020-01-09-c语言语法基础.html">
            
                    
                    3.2020-01-09-c语言语法基础
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.3" >
            
                <span>
            
                    
                    [DataStructureandAlgorithms]
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.3.1" data-path="../DataStructureandAlgorithms/2019-12-28-数据结构和算法的关系.html">
            
                <a href="../DataStructureandAlgorithms/2019-12-28-数据结构和算法的关系.html">
            
                    
                    1.2019-12-28-数据结构和算法的关系
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.3.2" data-path="../DataStructureandAlgorithms/2019-12-28-稀疏数组.html">
            
                <a href="../DataStructureandAlgorithms/2019-12-28-稀疏数组.html">
            
                    
                    2.2019-12-28-稀疏数组
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.4" >
            
                <span>
            
                    
                    [git]
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.4.1" data-path="../git/2019-12-28-git-alias.html">
            
                <a href="../git/2019-12-28-git-alias.html">
            
                    
                    1.2019-12-28-git-alias
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.4.2" data-path="../git/2019-12-29-git常用命令.html">
            
                <a href="../git/2019-12-29-git常用命令.html">
            
                    
                    2.2019-12-29-git常用命令
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.4.3" data-path="../git/2019-12-31-git教程.html">
            
                <a href="../git/2019-12-31-git教程.html">
            
                    
                    3.2019-12-31-git教程
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.5" >
            
                <span>
            
                    
                    [go]
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.5.1" data-path="../go/2019-12-30-beego基本使用.html">
            
                <a href="../go/2019-12-30-beego基本使用.html">
            
                    
                    1.2019-12-30-beego基本使用
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.6" >
            
                <span>
            
                    
                    [java]
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.6.1" data-path="../java/2019-12-30-环境变量和系统属性.html">
            
                <a href="../java/2019-12-30-环境变量和系统属性.html">
            
                    
                    1.2019-12-30-环境变量和系统属性
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.6.2" data-path="../java/2019-12-31-cloud-native-云原生.html">
            
                <a href="../java/2019-12-31-cloud-native-云原生.html">
            
                    
                    2.2019-12-31-cloud-native-云原生
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.6.3" data-path="../java/2019-12-31-java语法难点.html">
            
                <a href="../java/2019-12-31-java语法难点.html">
            
                    
                    3.2019-12-31-java语法难点
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.6.4" data-path="../java/2019-12-31-设计模式.html">
            
                <a href="../java/2019-12-31-设计模式.html">
            
                    
                    4.2019-12-31-设计模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.6.5" data-path="../java/2020-01-12-Ajax跨域问题解决方案.html">
            
                <a href="../java/2020-01-12-Ajax跨域问题解决方案.html">
            
                    
                    5.2020-01-12-Ajax跨域问题解决方案
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.6.6" data-path="../java/2020-01-12-freemarker应用场景介绍.html">
            
                <a href="../java/2020-01-12-freemarker应用场景介绍.html">
            
                    
                    6.2020-01-12-freemarker应用场景介绍
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.6.7" data-path="../java/2020-01-12-jsp运行原理和运行过程.html">
            
                <a href="../java/2020-01-12-jsp运行原理和运行过程.html">
            
                    
                    7.2020-01-12-jsp运行原理和运行过程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.6.8" data-path="../java/2020-01-12-深入理解Maven中的Profile.html">
            
                <a href="../java/2020-01-12-深入理解Maven中的Profile.html">
            
                    
                    8.2020-01-12-深入理解Maven中的Profile
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.6.9" data-path="../java/2020-01-12-缓存穿透-缓存击穿-缓存雪崩概念及解决方案.html">
            
                <a href="../java/2020-01-12-缓存穿透-缓存击穿-缓存雪崩概念及解决方案.html">
            
                    
                    9.2020-01-12-缓存穿透-缓存击穿-缓存雪崩概念及解决方案
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.6.10" data-path="../java/2020-01-13-事务笔记.html">
            
                <a href="../java/2020-01-13-事务笔记.html">
            
                    
                    10.2020-01-13-事务笔记
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.6.11" data-path="../java/2020-01-13-幂等性.html">
            
                <a href="../java/2020-01-13-幂等性.html">
            
                    
                    11.2020-01-13-幂等性
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.6.12" data-path="../java/2020-01-16-java基本语法.html">
            
                <a href="../java/2020-01-16-java基本语法.html">
            
                    
                    12.2020-01-16-java基本语法
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.7" >
            
                <span>
            
                    
                    [arthas]
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.7.1" data-path="../java/arthas/2019-12-28-arthas-example.html">
            
                <a href="../java/arthas/2019-12-28-arthas-example.html">
            
                    
                    1.2019-12-28-arthas-example
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.7.2" data-path="../java/arthas/2019-12-28-arthas添加支持执行历史命令的shell功能.html">
            
                <a href="../java/arthas/2019-12-28-arthas添加支持执行历史命令的shell功能.html">
            
                    
                    2.2019-12-28-arthas添加支持执行历史命令的shell功能
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.7.3" data-path="../java/arthas/2020-01-10-思考性能调优.html">
            
                <a href="../java/arthas/2020-01-10-思考性能调优.html">
            
                    
                    3.2020-01-10-思考性能调优
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.7.4" data-path="../java/arthas/2020-01-10-性能调优举例-最佳实践.html">
            
                <a href="../java/arthas/2020-01-10-性能调优举例-最佳实践.html">
            
                    
                    4.2020-01-10-性能调优举例-最佳实践
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.7.5" data-path="../java/arthas/2020-01-10-性能调优举例一.html">
            
                <a href="../java/arthas/2020-01-10-性能调优举例一.html">
            
                    
                    5.2020-01-10-性能调优举例一
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.7.6" data-path="../java/arthas/2020-01-10-性能调优举例三.html">
            
                <a href="../java/arthas/2020-01-10-性能调优举例三.html">
            
                    
                    6.2020-01-10-性能调优举例三
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.7.7" data-path="../java/arthas/2020-01-10-性能调优举例二.html">
            
                <a href="../java/arthas/2020-01-10-性能调优举例二.html">
            
                    
                    7.2020-01-10-性能调优举例二
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.7.8" data-path="../java/arthas/2020-01-10-性能调优举例四.html">
            
                <a href="../java/arthas/2020-01-10-性能调优举例四.html">
            
                    
                    8.2020-01-10-性能调优举例四
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.7.9" data-path="../java/arthas/2020-01-15-性能调优举例五.html">
            
                <a href="../java/arthas/2020-01-15-性能调优举例五.html">
            
                    
                    9.2020-01-15-性能调优举例五
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.7.10" data-path="../java/arthas/2020-05-12-性能调优举例六.html">
            
                <a href="../java/arthas/2020-05-12-性能调优举例六.html">
            
                    
                    10.2020-05-12-性能调优举例六
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.7.11" data-path="../java/arthas/arthas-mind-map.html">
            
                <a href="../java/arthas/arthas-mind-map.html">
            
                    
                    11.arthas-mind-map
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.8" >
            
                <span>
            
                    
                    [dubbo]
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.8.1" data-path="../java/dubbo/2019-12-28-dubbo涉及的技术.html">
            
                <a href="../java/dubbo/2019-12-28-dubbo涉及的技术.html">
            
                    
                    1.2019-12-28-dubbo涉及的技术
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.8.2" data-path="../java/dubbo/2019-12-30-dubbo消费者访问流程.html">
            
                <a href="../java/dubbo/2019-12-30-dubbo消费者访问流程.html">
            
                    
                    2.2019-12-30-dubbo消费者访问流程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.8.3" data-path="../java/dubbo/2019-12-30-dubbo面试.html">
            
                <a href="../java/dubbo/2019-12-30-dubbo面试.html">
            
                    
                    3.2019-12-30-dubbo面试
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.9" >
            
                <span>
            
                    
                    [jdk]
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.9.1" data-path="../java/jdk/2020-01-12-实例介绍 JAVA 泛型基础.html">
            
                <a href="../java/jdk/2020-01-12-实例介绍 JAVA 泛型基础.html">
            
                    
                    1.2020-01-12-实例介绍 JAVA 泛型基础
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.9.2" data-path="../java/jdk/2020-01-13-ThreadLocal六连问.html">
            
                <a href="../java/jdk/2020-01-13-ThreadLocal六连问.html">
            
                    
                    2.2020-01-13-ThreadLocal六连问
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.10" >
            
                <span>
            
                    
                    [jvm]
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.10.1" data-path="../java/jvm/2019-12-30-性能调优.html">
            
                <a href="../java/jvm/2019-12-30-性能调优.html">
            
                    
                    1.2019-12-30-性能调优
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.11" >
            
                <span>
            
                    
                    [netty]
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.11.1" data-path="../java/netty/2020-01-16-netty入门.html">
            
                <a href="../java/netty/2020-01-16-netty入门.html">
            
                    
                    1.2020-01-16-netty入门
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.11.2" data-path="../java/netty/2020-01-16-netty核心概念.html">
            
                <a href="../java/netty/2020-01-16-netty核心概念.html">
            
                    
                    2.2020-01-16-netty核心概念
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.12" >
            
                <span>
            
                    
                    [solr]
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.12.1" data-path="../java/solr/2019-12-28-solr-7.6.0.tgz安装.html">
            
                <a href="../java/solr/2019-12-28-solr-7.6.0.tgz安装.html">
            
                    
                    1.2019-12-28-solr-7.6.0.tgz安装
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.13" >
            
                <span>
            
                    
                    [spring]
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.13.1" data-path="../java/spring/2020-01-12-SpringBoot属性读取方式介绍.html">
            
                <a href="../java/spring/2020-01-12-SpringBoot属性读取方式介绍.html">
            
                    
                    1.2020-01-12-SpringBoot属性读取方式介绍
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.13.2" data-path="../java/spring/2020-01-12-使用spring boot+mybatis plus快速入门.html">
            
                <a href="../java/spring/2020-01-12-使用spring boot+mybatis plus快速入门.html">
            
                    
                    2.2020-01-12-使用spring boot+mybatis plus快速入门
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.13.3" data-path="../java/spring/2020-01-13-spring-initMethod-destoryMethod.html">
            
                <a href="../java/spring/2020-01-13-spring-initMethod-destoryMethod.html">
            
                    
                    3.2020-01-13-spring-initMethod-destoryMethod
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.13.4" data-path="../java/spring/2020-01-13-spring循环依赖.html">
            
                <a href="../java/spring/2020-01-13-spring循环依赖.html">
            
                    
                    4.2020-01-13-spring循环依赖
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.13.5" data-path="../java/spring/2020-01-13-spring源码随记.html">
            
                <a href="../java/spring/2020-01-13-spring源码随记.html">
            
                    
                    5.2020-01-13-spring源码随记
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.13.6" data-path="../java/spring/2020-01-13-自定义mini-spring.html">
            
                <a href="../java/spring/2020-01-13-自定义mini-spring.html">
            
                    
                    6.2020-01-13-自定义mini-spring
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.14" >
            
                <span>
            
                    
                    [websocket]
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.14.1" data-path="../java/websocket/2019-12-30-webscoket-springboot通信.html">
            
                <a href="../java/websocket/2019-12-30-webscoket-springboot通信.html">
            
                    
                    1.2019-12-30-webscoket-springboot通信
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.15" >
            
                <span>
            
                    
                    [linux]
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.15.1" data-path="2019-12-28-Linux常用命令和快捷键.html">
            
                <a href="2019-12-28-Linux常用命令和快捷键.html">
            
                    
                    1.2019-12-28-Linux常用命令和快捷键
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="2.15.2" data-path="2019-12-28-从零到一环境安装.html">
            
                <a href="2019-12-28-从零到一环境安装.html">
            
                    
                    2.2019-12-28-从零到一环境安装
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.15.3" data-path="2019-12-30-vi-常用命令.html">
            
                <a href="2019-12-30-vi-常用命令.html">
            
                    
                    3.2019-12-30-vi-常用命令
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.15.4" data-path="2019-12-31-awk命令.html">
            
                <a href="2019-12-31-awk命令.html">
            
                    
                    4.2019-12-31-awk命令
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.15.5" data-path="2019-12-31-cup信息分析.html">
            
                <a href="2019-12-31-cup信息分析.html">
            
                    
                    5.2019-12-31-cup信息分析
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.15.6" data-path="2019-12-31-shell编程.html">
            
                <a href="2019-12-31-shell编程.html">
            
                    
                    6.2019-12-31-shell编程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.15.7" data-path="2019-12-31-top命令.html">
            
                <a href="2019-12-31-top命令.html">
            
                    
                    7.2019-12-31-top命令
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.15.8" data-path="2019-12-31-普通用户docker的问题.html">
            
                <a href="2019-12-31-普通用户docker的问题.html">
            
                    
                    8.2019-12-31-普通用户docker的问题
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.15.9" data-path="2020-01-01-centos7 安装kubernetes.html">
            
                <a href="2020-01-01-centos7 安装kubernetes.html">
            
                    
                    9.2020-01-01-centos7 安装kubernetes
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.15.10" data-path="2020-01-01-centos安装常用配置.html">
            
                <a href="2020-01-01-centos安装常用配置.html">
            
                    
                    10.2020-01-01-centos安装常用配置
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.15.11" data-path="2020-01-01-docker使用.html">
            
                <a href="2020-01-01-docker使用.html">
            
                    
                    11.2020-01-01-docker使用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.15.12" data-path="2020-01-01-kubernetes使用.html">
            
                <a href="2020-01-01-kubernetes使用.html">
            
                    
                    12.2020-01-01-kubernetes使用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.15.13" data-path="2020-05-12-PG有用的SQL.html">
            
                <a href="2020-05-12-PG有用的SQL.html">
            
                    
                    13.2020-05-12-PG有用的SQL
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.15.14" data-path="2020-05-12-vim命令.html">
            
                <a href="2020-05-12-vim命令.html">
            
                    
                    14.2020-05-12-vim命令
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.16" >
            
                <span>
            
                    
                    [automate]
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.16.1" data-path="automate/2020-01-12-redis伪集群创建脚本.html">
            
                <a href="automate/2020-01-12-redis伪集群创建脚本.html">
            
                    
                    1.2020-01-12-redis伪集群创建脚本
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.16.2" data-path="automate/2020-01-12-tomcat集群创建脚本.html">
            
                <a href="automate/2020-01-12-tomcat集群创建脚本.html">
            
                    
                    2.2020-01-12-tomcat集群创建脚本
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.16.3" data-path="automate/2020-01-12-zookeeper自动化脚本.html">
            
                <a href="automate/2020-01-12-zookeeper自动化脚本.html">
            
                    
                    3.2020-01-12-zookeeper自动化脚本
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.16.4" data-path="automate/2020-01-12-其他自动化脚本.html">
            
                <a href="automate/2020-01-12-其他自动化脚本.html">
            
                    
                    4.2020-01-12-其他自动化脚本
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.17" >
            
                <span>
            
                    
                    [MySQL]
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.17.1" data-path="../MySQL/2019-12-31-mysql常用命令.html">
            
                <a href="../MySQL/2019-12-31-mysql常用命令.html">
            
                    
                    1.2019-12-31-mysql常用命令
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.18" >
            
                <span>
            
                    
                    [nginx]
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.18.1" data-path="../nginx/2019-12-29-Nginx-Keepalived高可用集群.html">
            
                <a href="../nginx/2019-12-29-Nginx-Keepalived高可用集群.html">
            
                    
                    1.2019-12-29-Nginx-Keepalived高可用集群
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.18.2" data-path="../nginx/2020-01-16-nginx参数详细说明.html">
            
                <a href="../nginx/2020-01-16-nginx参数详细说明.html">
            
                    
                    2.2020-01-16-nginx参数详细说明
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.19" >
            
                <span>
            
                    
                    [other]
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.19.1" data-path="../other/2019-12-28-知识小计.html">
            
                <a href="../other/2019-12-28-知识小计.html">
            
                    
                    1.2019-12-28-知识小计
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.19.2" data-path="../other/2020-01-04-科学上网.html">
            
                <a href="../other/2020-01-04-科学上网.html">
            
                    
                    2.2020-01-04-科学上网
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.19.3" data-path="../other/2020-05-13-正则表达式.html">
            
                <a href="../other/2020-05-13-正则表达式.html">
            
                    
                    3.2020-05-13-正则表达式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.19.4" data-path="../other/template.html">
            
                <a href="../other/template.html">
            
                    
                    4.template
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.20" >
            
                <span>
            
                    
                    [PostgreSQL]
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.20.1" data-path="../PostgreSQL/2019-12-28-PostgreSQL安装文档.html">
            
                <a href="../PostgreSQL/2019-12-28-PostgreSQL安装文档.html">
            
                    
                    1.2019-12-28-PostgreSQL安装文档
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.20.2" data-path="../PostgreSQL/2019-12-28-Postgres学习笔记.html">
            
                <a href="../PostgreSQL/2019-12-28-Postgres学习笔记.html">
            
                    
                    2.2019-12-28-Postgres学习笔记
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.20.3" data-path="../PostgreSQL/2019-12-28-脚本MYSQL导出数据到PG.html">
            
                <a href="../PostgreSQL/2019-12-28-脚本MYSQL导出数据到PG.html">
            
                    
                    3.2019-12-28-脚本MYSQL导出数据到PG
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.20.4" data-path="../PostgreSQL/2020-01-04-docker-PostgreSQL安装文档.html">
            
                <a href="../PostgreSQL/2020-01-04-docker-PostgreSQL安装文档.html">
            
                    
                    4.2020-01-04-docker-PostgreSQL安装文档
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.20.5" data-path="../PostgreSQL/2020-01-17-阿里云PG主从切换问题.html">
            
                <a href="../PostgreSQL/2020-01-17-阿里云PG主从切换问题.html">
            
                    
                    5.2020-01-17-阿里云PG主从切换问题
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.21" >
            
                <span>
            
                    
                    [python]
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.21.1" data-path="../python/2019-12-28-pip-install指定国内源镜像.html">
            
                <a href="../python/2019-12-28-pip-install指定国内源镜像.html">
            
                    
                    1.2019-12-28-pip-install指定国内源镜像
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.21.2" data-path="../python/2019-12-30-python内置函数.html">
            
                <a href="../python/2019-12-30-python内置函数.html">
            
                    
                    2.2019-12-30-python内置函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.21.3" data-path="../python/2019-12-30-一图搞懂基本python语法 .html">
            
                <a href="../python/2019-12-30-一图搞懂基本python语法 .html">
            
                    
                    3.2019-12-30-一图搞懂基本python语法 
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.22" >
            
                <span>
            
                    
                    [redis]
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.22.1" data-path="../redis/2019-12-28-redis5.0.3安装.html">
            
                <a href="../redis/2019-12-28-redis5.0.3安装.html">
            
                    
                    1.2019-12-28-redis5.0.3安装
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.22.2" data-path="../redis/2019-12-28-redis5.0.3集群搭建.html">
            
                <a href="../redis/2019-12-28-redis5.0.3集群搭建.html">
            
                    
                    2.2019-12-28-redis5.0.3集群搭建
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.23" >
            
                <span>
            
                    
                    [tool]
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.23.1" data-path="../tool/2019-12-28-idea高效使用技巧和快捷键.html">
            
                <a href="../tool/2019-12-28-idea高效使用技巧和快捷键.html">
            
                    
                    1.2019-12-28-idea高效使用技巧和快捷键
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.23.2" data-path="../tool/2019-12-28-PlantUML画图脚本.html">
            
                <a href="../tool/2019-12-28-PlantUML画图脚本.html">
            
                    
                    2.2019-12-28-PlantUML画图脚本
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.23.3" data-path="../tool/2019-12-30-vscode高效使用.html">
            
                <a href="../tool/2019-12-30-vscode高效使用.html">
            
                    
                    3.2019-12-30-vscode高效使用
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2.24" >
            
                <span>
            
                    
                    [windows]
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.24.1" data-path="../windows/2020-01-12-本地服务成为互联网服务.html">
            
                <a href="../windows/2020-01-12-本地服务成为互联网服务.html">
            
                    
                    1.2020-01-12-本地服务成为互联网服务
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="2.24.2" data-path="../windows/2020-01-12-注册bat为windows服务.html">
            
                <a href="../windows/2020-01-12-注册bat为windows服务.html">
            
                    
                    2.2020-01-12-注册bat为windows服务
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >2.2019-12-28-从零到一环境安装</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <p>&#x73AF;&#x5883;&#x90E8;&#x7F72;&#x4ECE;&#x96F6;&#x5230;&#x4E00;&#x7684;&#x5B89;&#x88C5;&#x6B65;&#x9AA4;</p>
<h2 id="docker-&#x5FEB;&#x901F;&#x5BB9;&#x5668;&#x811A;&#x672C;">docker &#x5FEB;&#x901F;&#x5BB9;&#x5668;&#x811A;&#x672C;</h2>
<pre><code class="lang-shell">#!/bin/bash
# &#x5FEB;&#x901F;&#x8FDB;&#x5165;docker&#x5BB9;&#x5668;&#x811A;&#x672C;
echo &quot;entering docker &quot;$1

CONTAINER_ID=$(sudo docker ps|grep $1|awk &apos;{print $1}&apos;)
sudo docker exec -it ${CONTAINER_ID} /bin/bash
</code></pre>
<h2 id="1&#x5B89;&#x88C5;linux">1.&#x5B89;&#x88C5;linux</h2>
<p>centos7 &#x6D4B;&#x8BD5;&#x7528;vmware  </p>
<p>root ZLC&amp;2019@jd</p>
<p>&#x963F;&#x91CC;&#x4E91;</p>
<p>&#x817E;&#x8BAF;&#x4E91;</p>
<p>&#x4E9A;&#x9A6C;&#x900A;&#x4E91;
...</p>
<p>&#x4EFB;&#x4F55;&#x53EF;&#x8BBF;&#x95EE;&#x670D;&#x52A1;&#x5668;&#x5747;&#x53EF;</p>
<p>&#x7533;&#x8BF7;&#x57DF;&#x540D;  &#x6D4B;&#x8BD5;&#x7528;switchhost
192.168.139.133 www.zlc.com
192.168.139.133 www.nginx.com
192.168.139.133 www.tomcat.com
192.168.139.133 www.gitlab.com</p>
<h2 id="2&#x5B89;&#x88C5;docker">2.&#x5B89;&#x88C5;docker</h2>
<p>&#x5B89;&#x88C5;
yum install -y docker </p>
<p>&#x542F;&#x52A8;
systemctl start docker</p>
<p>&#x67E5;&#x955C;&#x50CF;
docker images</p>
<p>&#x641C;&#x955C;&#x50CF;
docker search mysql</p>
<p>&#x4E0B;&#x955C;&#x50CF;
docker pull mysql</p>
<p>linux docker &#x6307;&#x5B9A;&#x5BB9;&#x5668;IP&#xFF08;docker&#x9ED8;&#x8BA4; &#x5BB9;&#x5668;ip&#x4F1A;&#x53D8;&#x89E3;&#x51B3;&#xFF09;
&#x4E00;&#x3001;&#x521B;&#x5EFA;&#x81EA;&#x5DF1;&#x7684;&#x7F51;&#x7EDC;&#x7C7B;&#x578B;&#x5E76;&#x6307;&#x5B9A;&#x7F51;&#x6BB5;
           &#x547D;&#x4EE4;     docker network create --subnet=172.18.0.0/16 mynetwork</p>
<p>&#x4E8C;&#x3001;&#x955C;&#x50CF;&#x542F;&#x52A8;&#x8FD0;&#x884C;&#x65F6;&#x6307;&#x5B9A;&#x81EA;&#x5DF1;&#x7684;&#x7F51;&#x7EDC;IP
           &#x547D;&#x4EE4;      docker run  -itd  -p 5001:5001 --name &#x955C;&#x50CF;&#x540D;&#x79F0; --net mynetwork --ip 172.18.0.2 --privileged=true --restart=always -d &#x955C;&#x50CF;&#x540D;&#x79F0;</p>
<p>&#x4E09;&#x3001;&#x91CD;&#x542F;docker&#x3001;&#x67E5;&#x770B;&#x5BB9;&#x5668;IP
          &#x91CD;&#x542F;dockers     &#x547D;&#x4EE4;     service docker restart</p>
<pre><code>      &#x67E5;&#x770B;&#x6240;&#x6709;&#x5BB9;&#x5668;    &#x547D;&#x4EE4;     docker  ps -a

      &#x67E5;&#x770B;&#x5BB9;&#x5668;&#x4FE1;&#x606F;     &#x547D;&#x4EE4;    docker inspect  &#x5BB9;&#x5668;&#x540D;&#x79F0;
</code></pre><p>&#x2014;&#x2014;&#x2014;&#x2014;&#x2014;&#x2014;&#x2014;&#x2014;&#x2014;&#x2014;&#x2014;&#x2014;&#x2014;&#x2014;&#x2014;&#x2014;
&#x7248;&#x6743;&#x58F0;&#x660E;&#xFF1A;&#x672C;&#x6587;&#x4E3A;CSDN&#x535A;&#x4E3B;&#x300C;&#x98CE;&#x5439;&#x86CB;&#x86CB;&#x98D8;~&#x300D;&#x7684;&#x539F;&#x521B;&#x6587;&#x7AE0;&#xFF0C;&#x9075;&#x5FAA; CC 4.0 BY-SA &#x7248;&#x6743;&#x534F;&#x8BAE;&#xFF0C;&#x8F6C;&#x8F7D;&#x8BF7;&#x9644;&#x4E0A;&#x539F;&#x6587;&#x51FA;&#x5904;&#x94FE;&#x63A5;&#x53CA;&#x672C;&#x58F0;&#x660E;&#x3002;
&#x539F;&#x6587;&#x94FE;&#x63A5;&#xFF1A;<a href="https://blog.csdn.net/baidu_26504655/article/details/90409811" target="_blank">https://blog.csdn.net/baidu_26504655/article/details/90409811</a></p>
<p>&#x6DFB;&#x52A0;&#x56FD;&#x5185;&#x955C;&#x50CF;&#x52A0;&#x901F;
vi /etc/docker/daemon.json
{
  &quot;registry-mirrors&quot; : [
    &quot;<a href="http://docker.mirrors.ustc.edu.cn" target="_blank">http://docker.mirrors.ustc.edu.cn</a>&quot;,
    &quot;<a href="http://hub-mirror.c.163.com" target="_blank">http://hub-mirror.c.163.com</a>&quot;,
    &quot;registry.docker-cn.com&quot;
  ],
  &quot;insecure-registries&quot; : [
    &quot;registry.docker-cn.com&quot;,
    &quot;docker.mirrors.ustc.edu.cn&quot;
  ],
  &quot;debug&quot; : true,
  &quot;experimental&quot; : true
}</p>
<p>systemctl restart docker</p>
<h2 id="3mysql">3.mysql</h2>
<p>docker pull mysql</p>
<p>docker run -di --name=mysqldb -p 33306:3306 centos/mysql-57-centos7</p>
<p>&#x4E0A;&#x8FF0;&#x547D;&#x4EE4;&#x65E0;&#x6CD5;&#x6B63;&#x5E38;&#x542F;&#x52A8;
&#x67E5;&#x770B;&#x65E5;&#x5FD7;
 docker logs containerid</p>
<p> =&gt; sourcing 20-validate-variables.sh ...
You must either specify the following environment variables:
  MYSQL<em>USER (regex: &apos;^[a-zA-Z0-9</em>]+$&apos;)
  MYSQL<em>PASSWORD (regex: &apos;^[a-zA-Z0-9</em>~!@#$%^&amp;<em>()-=&lt;&gt;,.?;:|]+$&apos;)
  MYSQL<em>DATABASE (regex: &apos;^[a-zA-Z0-9</em>]+$&apos;)
Or the following environment variable:
  MYSQL<em>ROOT_PASSWORD (regex: &apos;^[a-zA-Z0-9</em>~!@#$%^&amp;</em>()-=&lt;&gt;,.?;:|]+$&apos;)
Or both.
Optional Settings:
  MYSQL_LOWER_CASE_TABLE_NAMES (default: 0)
  MYSQL_LOG_QUERIES_ENABLED (default: 0)
  MYSQL_MAX_CONNECTIONS (default: 151)
  MYSQL_FT_MIN_WORD_LEN (default: 4)
  MYSQL_FT_MAX_WORD_LEN (default: 20)
  MYSQL_AIO (default: 1)
  MYSQL_KEY_BUFFER_SIZE (default: 32M or 10% of available memory)
  MYSQL_MAX_ALLOWED_PACKET (default: 200M)
  MYSQL_TABLE_OPEN_CACHE (default: 400)
  MYSQL_SORT_BUFFER_SIZE (default: 256K)
  MYSQL_READ_BUFFER_SIZE (default: 8M or 5% of available memory)
  MYSQL_INNODB_BUFFER_POOL_SIZE (default: 32M or 50% of available memory)
  MYSQL_INNODB_LOG_FILE_SIZE (default: 8M or 15% of available memory)
  MYSQL_INNODB_LOG_BUFFER_SIZE (default: 8M or 15% of available memory)
For more information, see <a href="https://github.com/sclorg/mysql-container" target="_blank">https://github.com/sclorg/mysql-container</a></p>
<p>&#x4ECE;&#x65E5;&#x5FD7;&#x4E2D;&#x53D1;&#x73B0;&#x9700;&#x8981;&#x7ED9;&#x5B9A;&#x542F;&#x52A8;&#x53C2;&#x6570;  MYSQL_ROOT_PASSWORD
docker run -di --name=mysqldb -p 33306:3306 -e MYSQL_ROOT_PASSWORD=ZLC@docker?  centos/mysql-57-centos7</p>
<p>mysql &#x521B;&#x5EFA;&#x666E;&#x901A;&#x7528;&#x6237;</p>
<h2 id="4nginx">4.nginx</h2>
<p>&#x65B0;&#x5EFA;&#x7528;&#x6237;</p>
<p>docker pull nginx</p>
<p>docker run -di --name=mynginx -p 80:80 nginx</p>
<p><a href="http://192.168.x.x/" target="_blank">http://192.168.x.x/</a> &#x80FD;&#x8BBF;&#x95EE;</p>
<p>&#x914D;&#x7F6E;&#x57DF;&#x540D;</p>
<p>&#x4E0B;&#x8F7D; switchhost</p>
<p>&#x6839;&#x636E;&#x57DF;&#x540D;&#x7ED1;&#x5B9A;</p>
<p>docker cp nginx.conf mynginx:/etc/nginx/
docker restart mynginx</p>
<p>nginx.conf &#x53CD;&#x5411;&#x4EE3;&#x7406;&#xFF0C;&#x8D1F;&#x8F7D;&#x5747;&#x8861;</p>
<p>user  nginx;
worker_processes  1;</p>
<p>error_log  /var/log/nginx/error.log warn;
pid        /var/run/nginx.pid;</p>
<p>events {
    worker_connections  1024;
}</p>
<p>http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;</p>
<pre><code>log_format  main  &apos;$remote_addr - $remote_user [$time_local] &quot;$request&quot; &apos;
                  &apos;$status $body_bytes_sent &quot;$http_referer&quot; &apos;
                  &apos;&quot;$http_user_agent&quot; &quot;$http_x_forwarded_for&quot;&apos;;

access_log  /var/log/nginx/access.log  main;

sendfile        on;
#tcp_nopush     on;

keepalive_timeout  65;

#gzip  on;

include /etc/nginx/conf.d/*.conf;

upstream tomcat-upstream {
    server 172.17.0.4:8080;
} 
server { 
    listen 80;
    server_name www.tomcat.com;
    location / {
      proxy_pass http://tomcat-upstream;
    }
}
</code></pre><p>}</p>
<h2 id="5gitlab">5.gitlab</h2>
<pre><code class="lang-shell">&#x4E00;&#x3001;&#x5B89;&#x88C5;&#x53CA;&#x914D;&#x7F6E;
1.gitlab&#x955C;&#x50CF;&#x62C9;&#x53D6;
# gitlab-ce&#x4E3A;&#x7A33;&#x5B9A;&#x7248;&#x672C;&#xFF0C;&#x540E;&#x9762;&#x4E0D;&#x586B;&#x5199;&#x7248;&#x672C;&#x5219;&#x9ED8;&#x8BA4;pull&#x6700;&#x65B0;latest&#x7248;&#x672C;
$ docker pull gitlab/gitlab-ce

2.&#x8FD0;&#x884C;gitlab&#x955C;&#x50CF;
$ docker run -di  -p 443:443 -p 81:80 -p 222:22 --name gitlab -v /home/gitlab/config:/etc/gitlab -v /home/gitlab/logs:/var/log/gitlab -v /home/gitlab/data:/var/opt/gitlab --privileged=true gitlab/gitlab-ce 

&#x8BBF;&#x95EE;&#xFF1A;http://192.168.139.133:81/gitlab   root &#x8BBE;&#x7F6E;&#x5BC6;&#x7801; ZLC&amp;2019@jd
&#x8BBF;&#x95EE;&#xFF1A;http://172.20.183.184:81/gitlab   root &#x8BBE;&#x7F6E;&#x5BC6;&#x7801; ZLC&amp;2019@jd

# -d&#xFF1A;&#x540E;&#x53F0;&#x8FD0;&#x884C;
# -p&#xFF1A;&#x5C06;&#x5BB9;&#x5668;&#x5185;&#x90E8;&#x7AEF;&#x53E3;&#x5411;&#x5916;&#x6620;&#x5C04;
# --name&#xFF1A;&#x547D;&#x540D;&#x5BB9;&#x5668;&#x540D;&#x79F0;
# -v&#xFF1A;&#x5C06;&#x5BB9;&#x5668;&#x5185;&#x6570;&#x636E;&#x6587;&#x4EF6;&#x5939;&#x6216;&#x8005;&#x65E5;&#x5FD7;&#x3001;&#x914D;&#x7F6E;&#x7B49;&#x6587;&#x4EF6;&#x5939;&#x6302;&#x8F7D;&#x5230;&#x5BBF;&#x4E3B;&#x673A;&#x6307;&#x5B9A;&#x76EE;&#x5F55;

&#x8FD0;&#x884C;&#x6210;&#x529F;&#x540E;&#x51FA;&#x73B0;&#x4E00;&#x4E32;&#x5B57;&#x7B26;&#x4E32;

3.&#x914D;&#x7F6E;
&#x6309;&#x4E0A;&#x9762;&#x7684;&#x65B9;&#x5F0F;&#xFF0C;gitlab&#x5BB9;&#x5668;&#x8FD0;&#x884C;&#x6CA1;&#x95EE;&#x9898;&#xFF0C;&#x4F46;&#x5728;gitlab&#x4E0A;&#x521B;&#x5EFA;&#x9879;&#x76EE;&#x7684;&#x65F6;&#x5019;&#xFF0C;&#x751F;&#x6210;&#x9879;&#x76EE;&#x7684;URL&#x8BBF;&#x95EE;&#x5730;&#x5740;&#x662F;&#x6309;&#x5BB9;&#x5668;&#x7684;hostname&#x6765;&#x751F;&#x6210;&#x7684;&#xFF0C;&#x4E5F;&#x5C31;&#x662F;&#x5BB9;&#x5668;&#x7684;id&#x3002;&#x4F5C;&#x4E3A;gitlab&#x670D;&#x52A1;&#x5668;&#xFF0C;&#x6211;&#x4EEC;&#x9700;&#x8981;&#x4E00;&#x4E2A;&#x56FA;&#x5B9A;&#x7684;URL&#x8BBF;&#x95EE;&#x5730;&#x5740;&#xFF0C;&#x4E8E;&#x662F;&#x9700;&#x8981;&#x914D;&#x7F6E;gitlab.rb&#xFF08;&#x5BBF;&#x4E3B;&#x673A;&#x8DEF;&#x5F84;&#xFF1A;/home/gitlab/config/gitlab.rb&#xFF09;&#x3002;

# gitlab.rb&#x6587;&#x4EF6;&#x5185;&#x5BB9;&#x9ED8;&#x8BA4;&#x5168;&#x662F;&#x6CE8;&#x91CA;
$ vim /home/gitlab/config/gitlab.rb
# &#x914D;&#x7F6E;http&#x534F;&#x8BAE;&#x6240;&#x4F7F;&#x7528;&#x7684;&#x8BBF;&#x95EE;&#x5730;&#x5740;,&#x4E0D;&#x52A0;&#x7AEF;&#x53E3;&#x53F7;&#x9ED8;&#x8BA4;&#x4E3A;80
external_url &apos;http://www.gitlab.com&apos;

# &#x914D;&#x7F6E;ssh&#x534F;&#x8BAE;&#x6240;&#x4F7F;&#x7528;&#x7684;&#x8BBF;&#x95EE;&#x5730;&#x5740;&#x548C;&#x7AEF;&#x53E3; &#x6DFB;&#x52A0;&#x4F1A;&#x62A5;&#x9519;&#xFF0C;&#x4E0D;&#x52A0;&#x4E5F;&#x884C;
&lt;!-- gitlab_rails[&apos;gitlab_ssh_host&apos;] = &apos;www.gitlab.com&apos;
gitlab_rails[&apos;gitlab_shell_ssh_port&apos;] = 222  --&gt;
# &#x6B64;&#x7AEF;&#x53E3;&#x662F;run&#x65F6;22&#x7AEF;&#x53E3;&#x6620;&#x5C04;&#x7684;222&#x7AEF;&#x53E3;
:wq #&#x4FDD;&#x5B58;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x5E76;&#x9000;&#x51FA;


&#x6DFB;&#x52A0;nginx&#x53CD;&#x5411;&#x4EE3;&#x7406;&#x6620;&#x5C04;
    upstream gitlab-upstream {
        server 172.17.0.5:80;
    } 
    server { 
        listen 80;
        server_name www.gitlab.com;
        location / {
          proxy_pass http://gitlab-upstream;
        }
    }
</code></pre>
<h2 id="6jenkins">6.jenkins</h2>
<p>1.pull&#x4E00;&#x4E2A;jenkins&#x955C;&#x50CF; docker pull jenkins/jenkins:lts;
&#x8FD9;&#x4E2A;&#x662F;&#x5B89;&#x88C5;&#x6700;&#x65B0;&#x7248;&#x7684;jenkins,&#x5982;&#x679C;&#x5B89;&#x88C5;&#x65E7;&#x7248;&#x672C;&#xFF0C;&#x5F88;&#x591A;&#x63D2;&#x4EF6;&#x5B89;&#x88C5;&#x4E0D;&#x4E0A;&#xFF0C;docker&#x73AF;&#x5883;&#x4E0B;&#x5347;&#x7EA7;&#x53C8;&#x6BD4;&#x8F83;&#x9EBB;&#x70E6;&#x3002;
&#x67E5;&#x770B;&#x662F;&#x5426;&#x662F;&#x6700;&#x65B0;&#x7248; docker inspect ba607c18aeb7
2.&#x67E5;&#x770B;&#x5DF2;&#x7ECF;&#x5B89;&#x88C5;&#x7684;jenkins&#x955C;&#x50CF; docker images;
3.&#x521B;&#x5EFA;&#x4E00;&#x4E2A;jenkins&#x76EE;&#x5F55; mkdir /home/jenkins_home;
4.&#x542F;&#x52A8;&#x4E00;&#x4E2A;jenkins&#x5BB9;&#x5668; docker run -d --name jenkins_01 -p 8081:8080 -v /home/jenkins_01:/home/jenkins_01 jenkins/jenkins:lts ;
5.&#x67E5;&#x770B;jenkins&#x670D;&#x52A1; docker ps | grep jenkins;
6.&#x542F;&#x52A8;&#x670D;&#x52A1;&#x7AEF; &#x3002;localhost:8081;
7.&#x8FDB;&#x5165;&#x5BB9;&#x5668;&#x5185;&#x90E8;docker exec -it jenkins_01 bash&#xFF1B;
8.&#x6267;&#x884C;&#xFF1A;cat /var/jenkins_home/secrets/initialAdminPassword&#xFF0C;&#x5F97;&#x5230;&#x5BC6;&#x7801;&#x5E76;&#x7C98;&#x8D34;&#x8FC7;&#x53BB;
9.&#x8F93;&#x5165;&#x5BC6;&#x7801;&#x4E4B;&#x540E;&#xFF0C;&#x91CD;&#x542F;docker&#x955C;&#x50CF; docker restart {CONTAINER ID}&#xFF0C;&#x5B89;&#x88C5;&#x5B8C;&#x6BD5;&#x3002;</p>
<p>&#x4F5C;&#x8005;&#xFF1A;&#x738B;&#x5927;&#x5408;
&#x94FE;&#x63A5;&#xFF1A;<a href="https://www.jianshu.com/p/12c9a9654f83" target="_blank">https://www.jianshu.com/p/12c9a9654f83</a>
&#x6765;&#x6E90;&#xFF1A;&#x7B80;&#x4E66;
&#x8457;&#x4F5C;&#x6743;&#x5F52;&#x4F5C;&#x8005;&#x6240;&#x6709;&#x3002;&#x5546;&#x4E1A;&#x8F6C;&#x8F7D;&#x8BF7;&#x8054;&#x7CFB;&#x4F5C;&#x8005;&#x83B7;&#x5F97;&#x6388;&#x6743;&#xFF0C;&#x975E;&#x5546;&#x4E1A;&#x8F6C;&#x8F7D;&#x8BF7;&#x6CE8;&#x660E;&#x51FA;&#x5904;&#x3002;</p>
<p>docker run -di --name jenkins  -p 18081:8080 --privileged=true jenkins </p>
<p>upstream www.myjenkins.com {
        server 172.17.0.6:8080;
    } 
    server { 
        listen 80;
        server_name www.myjenkins.com;
        location / {
          proxy_pass <a href="http://www.myjenkins.com" target="_blank">http://www.myjenkins.com</a>;
        }
    }</p>
<p>&#x8BBF;&#x95EE;&#xFF1A;<a href="http://www.myjenkins.com/" target="_blank">http://www.myjenkins.com/</a></p>
<p>&#x521D;&#x6B21;&#x8BBF;&#x95EE;&#x8981;&#x8F93;&#x5165;admin &#x5BC6;&#x7801; &#x5728;&#x6587;&#x4EF6;/var/jenkins_home/secrets/initialAdminPassword&#x4E2D;
&#x4ECE;&#x5BB9;&#x5668;&#x4E2D;&#x590D;&#x5236;&#x51FA;&#x5BC6;&#x7801;&#x6587;&#x4EF6; docker cp jenkins:/var/jenkins_home/secrets/initialAdminPassword initialAdminPassword</p>
<p>&#x521B;&#x5EFA;&#x7BA1;&#x7406;&#x5458;
admin/admin  zhuge</p>
<p>&#x67E5;&#x770B;&#x5BB9;&#x5668;&#x65E5;&#x5FD7;</p>
<p>docker logs -f jenkins</p>
<p>&#x67E5;&#x770B;&#x5BB9;&#x5668;&#x8FD0;&#x884C;</p>
<p>docker ps</p>
<h2 id="7tomcat">7.tomcat</h2>
<p>docker run -di --name=mytomcat -p 18080:8080 inovatrend/tomcat8-java8</p>
<p>--ip 172.18.0.2</p>
<p>docker run -di --name=mytomcat12 --net mynetwork --ip 172.18.0.12 -p 19080:8080 inovatrend/tomcat8-java8 
&#x9700;&#x8981;&#x6307;&#x5B9A;&#x7F51;&#x7EDC; /usr/bin/docker-current: Error response from daemon: User specified IP address is supported on user defined networks only.</p>
<p>&#x53CD;&#x5411;&#x4EE3;&#x7406;</p>
<p>upstream tomcat-upstream {
        server 172.17.0.4:8080;
    } 
    server { 
        listen 80;
        server_name www.tomcat.com;
        location / {
          proxy_pass <a href="http://tomcat-upstream" target="_blank">http://tomcat-upstream</a>;
        }
    }</p>
<h2 id="8springboot-jar-dockerfile">8.springboot-jar-dockerfile</h2>
<pre><code class="lang-shell">
Dockerfile

FROM avinb/jre8-64
VOLUME /tmp
ADD admin-server.jar /app.jar
ENTRYPOINT [&quot;java&quot;,&quot;-Djava.security.egd=file:/dev/./urandom&quot;,&quot;-jar&quot;,&quot;/app.jar&quot;]


#&#x6784;&#x5EFA;&#x547D;&#x4EE4;
 docker build -t admin-server:v1.0 .


&#x542F;&#x52A8;&#x5BB9;&#x5668;
  docker run -id --name springboot-admin-server -p 8769:8769 admin-server:v1.0


   # springboot-admin-server
   # &#x7279;&#x6B8A;&#x8981;&#x6C42;&#xFF0C;spring boot &#x9879;&#x76EE; &#x53CD;&#x5411;&#x4EE3;&#x7406;&#x7684;upstream &#x8981;&#x548C;&#x57DF;&#x540D;&#x4E00;&#x6837; &#x4E3B;&#x8981;&#x662F; springboot&#x4E2D;&#x9759;&#x6001;&#x8D44;&#x6E90;&#x4F1A;&#x4F7F;&#x7528;&#x4EE3;&#x7406;&#x7684;&#x5730;&#x5740;&#x8BBF;&#x95EE;
  upstream admin.server.com {
        server 172.17.0.5:8769;
    } 
    server { 
        listen 80;
        server_name admin.server.com;
        location / {
          proxy_pass http://admin.server.com;
        }
    }


    &#x6DFB;&#x52A0;&#x57DF;&#x540D;&#x4E3B;&#x673A;
     docker cp nginx.conf mynginx:/etc/nginx/nginx.conf
     docker restart mynginx
</code></pre>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="2019-12-28-Linux常用命令和快捷键.html" class="navigation navigation-prev " aria-label="Previous page: 1.2019-12-28-Linux常用命令和快捷键">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="2019-12-30-vi-常用命令.html" class="navigation navigation-next " aria-label="Next page: 3.2019-12-30-vi-常用命令">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"layout":"post","title":"2.2019-12-28-从零到一环境安装","categories":["linux","docker","mysql","nginx","git","jenkins","tomcat","springboot","tool"],"description":"从零到一环境安装","keywords":"linux,docker,mysql,nginx,git,jenkins,tomcat,springboot,tool","level":"2.15.2","depth":2,"next":{"title":"3.2019-12-30-vi-常用命令","level":"2.15.3","depth":2,"path":"linux/2019-12-30-vi-常用命令.md","ref":"linux/2019-12-30-vi-常用命令.md","articles":[]},"previous":{"title":"1.2019-12-28-Linux常用命令和快捷键","level":"2.15.1","depth":2,"path":"linux/2019-12-28-Linux常用命令和快捷键.md","ref":"linux/2019-12-28-Linux常用命令和快捷键.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":[],"pluginsConfig":{"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"linux/2019-12-28-从零到一环境安装.md","mtime":"2020-05-11T09:49:19.087Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2020-08-27T08:51:05.639Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

